# # 设置一个空列表
# list = []
# print(list)


# # + 号操作符用于组合列表
# a = [1, 2, 3]
# b = [4, 5, 6]
# c = a + b
# print(c)

# # * 号操作符用于重复列表
# a = [1, 2, 3]
# print(a * 3)

# # list.append(x)
# a = [1, 2, 3]
# a.append(4)
# print(a)

# # list.extend(iterable)
# a = [1, 2, 3]
# # a.extend([4, 5, 6])
# b = ["hello", "world"]
# a.extend(b)
# print(a)

# # list.copy()
# a = [1, 2, 3]
# print(id(a))
# b = a.copy()
# print(id(b))
# print(b)

# a = [1, 2, 3]
# print(id(a))
# b = a
# print(id(b))
# print(b)

# # list.remove(obj)
# a = [1, 2, 3]
# a.remove(2)
# print(a)

# # list.pop()
# a = [1, 2, 3]
# a.pop() # 括号内默认参数为：-1，可修改。
# print(a)

# # list.clear()
# a = [1, 2, 3]
# a.clear()
# print(a)

# # del list
# a = [1, 2, 3]
# # del a # 移除a这个变量对象
# # print(a) # 报错
#
# del a[0] # 删除指定索引的值
# print(a)

# # list()
# a = "Shawn Holmes Hu"
# b = list(a)
# print(b)
# b[0] = "A"
# print(b)

# # list.insert(index, obj)
# a = [1, 2, 3]
# a.insert(1, "一")
# print(a)

# len()
# a = [1, 2, 3]
# b = len(a)
# print(b)

# # max()
# # a = [1, 2, 3]
# # a = "Shawn Holmes Hu"
# a = "问道阁"
# b = max(a)
# print(b)


# # max()
# a = [1, 2, 3]
# # a = "Shawn Holmes Hu"
# # a = "问道阁"
# b = min(a)
# print(b)

# a = [1, 2, 3, "Shawn Holmes Hu"] # 元素类型不一致的示例
# b = min(a)
# print(b) # 报错

# # count(obj)
# alphabet = ["a","b","c","d","a","b","c","e"]
# num = alphabet.count("b")
# print(num)

# # index(obj)
# alphabet = ["a","b","c","d","a","b","c","e"]
# index = alphabet.index("b",2, -1)
# print(index)

# # 切片 slice [start : end : step]
# alphabet = ["a","b","c","d","a","b","c","e"]
# result = alphabet[2 : -1 : 2]
# # print(result)


# # list(index)
# alphabet = ["a","b","c","d","a","b","c","e"]
# result = alphabet[2]
# print(result)

# reverse()反转
# alphabet = ["a","b","c","d","a","b","c","e"]
# alphabet.reverse()
# print(alphabet)

# list.sort(key=None, reverse=Flase)
# fruits = ["banana", "apple", "cherry", "orange", "kiwi", "melon", "mango", "pear"]
#
# fruits.sort(key=len, reverse=True)
# print(fruits)

# list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# list.sort(key=lambda x: x % 2, reverse=True)
# print(list)


# # x in list
# list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# result = 5 not in list
# print(result)

# # operator 模块
a = [1, 2, 3]
b = [4, 5, 6]
c = [1, 2, 3]

import operator # 导入operator模块，必须在使用这个方法前，先导入此模块。
result = operator.eq(a, c)
print(result)

# print(dir(list))